package com.fuyao.cloud.admin.api.feign;

import com.fuyao.cloud.admin.api.dto.UserInfoParamsDTO;
import com.fuyao.cloud.admin.api.entity.SysUserinfo;
import com.fuyao.cloud.admin.api.vo.UserInfoDeptVO;
import com.fuyao.cloud.common.core.constant.SecurityConstants;
import com.fuyao.cloud.common.core.constant.ServiceNameConstants;
import com.fuyao.cloud.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 提供远程用户详细信息服务
 */
@FeignClient(contextId = "remoteUserInfoService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteUserInfoService {
    /**
     * 获取电话号码
     * @return
     */
    @PostMapping("/sysuserinfo/getMobiles")
    R<Map<String,String>> getMobiles(@RequestBody List<String> userNumbers);

    @GetMapping("/sysuserinfo/getUserinfoId/{personNum}")
    R getUserinfoId(@PathVariable("personNum") String personNum);

    @GetMapping("/sysuserinfo/info/{id}")
    R<SysUserinfo> getUserInfoById(@PathVariable("id") Long id);

    @GetMapping("/sysuserinfo/details/number/{number}")
    R<SysUserinfo> getByPersonnelNum(@PathVariable("number") String number);

    @GetMapping("/sysuserinfo/getUserInfoByUserName/{userName}")
    R<SysUserinfo> getUserInfoByUserName(@RequestHeader(SecurityConstants.FROM) String from, @PathVariable("userName") String userName);

    /**
     * 同步数据至oa
     */
    @PostMapping("/sysuserinfo/syncData")
    R syncData(@RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 同步OA数据到人事
     */
    @PostMapping("/sysuserinfo/syncOaData")
    R syncOaData(@RequestHeader(SecurityConstants.FROM) String from);


    /**
     * 获取userId
     * @return
     */
    @PostMapping("/sysuserinfo/getUserIds")
    R<List<Long>> getUserIds(@RequestBody List<Long> userInfoIds, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 获取用户信息详细集合
     * @param paramsDTO
     * @param from
     * @return
     */
    @PostMapping("/sysuserinfo/getUserDetailInfoList")
    R<List<UserInfoDeptVO>> getUserDetailInfoList(@RequestBody UserInfoParamsDTO paramsDTO, @RequestHeader(SecurityConstants.FROM) String from);
}
